﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class GsVectPerformanceData : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public GsVectPerformanceData(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(GsVectPerformanceData obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~GsVectPerformanceData()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_GsVectPerformanceData(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public GsVectPerformanceData() : this(GlobalsPINVOKE.new_GsVectPerformanceData(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool enableParallelVectorization()
		{
			bool result = GlobalsPINVOKE.GsVectPerformanceData_enableParallelVectorization(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool enableParallelDisplay()
		{
			bool result = GlobalsPINVOKE.GsVectPerformanceData_enableParallelDisplay(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool schedulerLogOutput()
		{
			bool result = GlobalsPINVOKE.GsVectPerformanceData_schedulerLogOutput(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool optimalThreadsNumber()
		{
			bool result = GlobalsPINVOKE.GsVectPerformanceData_optimalThreadsNumber(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool enablePerfMeasurements()
		{
			bool result = GlobalsPINVOKE.GsVectPerformanceData_enablePerfMeasurements(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool forcePartialUpdateForTest()
		{
			bool result = GlobalsPINVOKE.GsVectPerformanceData_forcePartialUpdateForTest(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public uint m_options
		{
			get
			{
				uint result = GlobalsPINVOKE.GsVectPerformanceData_m_options_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.GsVectPerformanceData_m_options_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public GsDevicePerformanceTm m_tm
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.GsVectPerformanceData_m_tm_get(this.swigCPtr);
				GsDevicePerformanceTm result = (intPtr == IntPtr.Zero) ? null : new GsDevicePerformanceTm(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.GsVectPerformanceData_m_tm_set(this.swigCPtr, GsDevicePerformanceTm.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public uint m_numVectUsedUpdateGeom
		{
			get
			{
				uint result = GlobalsPINVOKE.GsVectPerformanceData_m_numVectUsedUpdateGeom_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.GsVectPerformanceData_m_numVectUsedUpdateGeom_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public uint m_numVectUsedUpdateScr
		{
			get
			{
				uint result = GlobalsPINVOKE.GsVectPerformanceData_m_numVectUsedUpdateScr_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.GsVectPerformanceData_m_numVectUsedUpdateScr_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
